﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:amq="clr-namespace:AmCharts.Windows.QuickCharts"
    >
    <Style TargetType="amq:SerialChart">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="amq:SerialChart">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            Padding="{TemplateBinding Padding}"
                            >
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>

                            <amq:ValueAxis x:Name="PART_ValueAxis" Grid.Column="0" Grid.Row="0" Margin="0,0,0,-2" 
                                           Foreground="{TemplateBinding AxisForeground}"
                                           />
                            <amq:CategoryAxis x:Name="PART_CategoryAxis" Grid.Column="1" Grid.Row="1" 
                                              Foreground="{TemplateBinding AxisForeground}"
                                              />

                            <Border Grid.Column="1" Grid.Row="0" Background="{TemplateBinding PlotAreaBackground}">
                                <amq:ValueGrid x:Name="PART_ValueGrid" Foreground="{TemplateBinding GridStroke}" />
                            </Border>
                            
                            <Border x:Name="PART_GraphCanvasDecorator" Grid.Column="1" Grid.Row="0">
                                <Canvas x:Name="PART_GraphCanvas" Background="Transparent" />
                            </Border>

                            <amq:Legend x:Name="PART_Legend" Grid.Column="2" Grid.Row="0" 
                                        Margin="10,0,0,0" 
                                        Visibility="{TemplateBinding LegendVisibility}"
                                        />

                            <Canvas Grid.Column="1" Grid.Row="0">
                                <amq:Balloon x:Name="PART_Balloon" 
                                             BorderBrush="{TemplateBinding AxisForeground}" 
                                             BorderThickness="2"
                                             Visibility="Collapsed"
                                             />
                            </Canvas>

                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>